package com.jhhc.RHDB.Data.ServiceImpl;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jhhc.RHDB.Data.Pojo.ST_PPTN_R;
import com.jhhc.RHDB.Data.Service.ST_PPTN_RService;
import com.jhhc.RHDB.Data.Dao.ST_PPTN_RMapper;

@Service
@Transactional
public class ST_PPTN_RServiceImpl implements ST_PPTN_RService {
    @Autowired
    private ST_PPTN_RMapper ST_PPTN_RMapper;


    @Override
    public List<ST_PPTN_R> selectByStationArry(String Stations, String startTime, String endTime) {
        // TODO Auto-generated method stub
        //String stcdArr=ArryToString(Stations);
        return ST_PPTN_RMapper.selectByStationArry(Stations, startTime, endTime);
    }

    @Override
    public List<ST_PPTN_R> selectByStationArrys(List<String> Stations, String startTime, String endTime) {
        // TODO Auto-generated method stub
        //String stcdArr=ArryToString(Stations);
        return ST_PPTN_RMapper.selectByStationArrys(Stations, startTime, endTime);
    }

    @Override
    public int DeleteData(String Stations, String startTime, String endTime) {
        // TODO Auto-generated method stub
        return ST_PPTN_RMapper.DeleteData(Stations, startTime, endTime);
    }

    public String ArryToString(List<String> Stations) {
        // TODO Auto-generated method stub
        String stcdArr = "";
        for (int i = 0; i < Stations.size(); i++) {
            if (!stcdArr.trim().isEmpty() || !stcdArr.trim().equals("")) {
                stcdArr = Stations.get(i) + "," + stcdArr;
            } else {
                stcdArr = Stations.get(i);
            }

        }
        System.out.println("这是stcdarr" + stcdArr);
        return stcdArr;
    }


    @Override
    public Integer update(String stcd, String time) {
        // TODO Auto-generated method stub
        return null;
    }


    @Override
    @Transactional
    public int InsertData(ST_PPTN_R t) {
        // TODO Auto-generated method stub
        return ST_PPTN_RMapper.InsertData(t);
    }


    @Override
    public List<ST_PPTN_R> selectPPTNNewEstData(List<String>  stcd) {
        // TODO Auto-generated method stub
        return ST_PPTN_RMapper.selectPPTNNewEstData(stcd);
    }


    @Override
    public ST_PPTN_R selectSUM(String stcd, String startTime, String endTime) {
        // TODO Auto-generated method stub
        return ST_PPTN_RMapper.selectSUM(stcd, startTime, endTime);
    }

    @Override
    public List<ST_PPTN_R> selectSUM1(List<String> stcd, String startTime, String endTime) {
        return ST_PPTN_RMapper.selectSUM1(stcd, startTime, endTime);
    }

    @Override
    public List<ST_PPTN_R> selecStationRainfall(String stcd, String startTime, String endTime) {
        return ST_PPTN_RMapper.selecStationRainfall(stcd,startTime,endTime);
    }

    @Override
    public List<ST_PPTN_R> selecStationMonthRainfall(String stcd, String startTime, String endTime) {
        return ST_PPTN_RMapper.selecStationMonthRainfall(stcd,startTime,endTime);
    }

    @Override
    public List<ST_PPTN_R> selecMultiStationDailyRainfall(List<String> stcd, String startTime, String endTime) {
        return ST_PPTN_RMapper.selecMultiStationDailyRainfall(stcd,startTime,endTime);
    }

    @Override
    public List<ST_PPTN_R> selectMultiStationMonthRainfall(List<String> stcd, String startTime, String endTime) {
        return ST_PPTN_RMapper.selectMultiStationMonthRainfall(stcd,startTime,endTime);
    }

//    @Override
//    public List<ST_PPTN_R> selectMultiStationMonthRainfall(List<String> stcd,  String startTime, String endTime) {
//        return ST_PPTN_RMapper.selecStationMonthRainfall(stcd,startTime,endTime);
//    }

    @Override
    public List<ST_PPTN_R> selectSumMonthRainfall(List<String> stcd, String startTime, String endTime) {
        return ST_PPTN_RMapper.selectSumMonthRainfall(stcd,startTime,endTime);
    }

    @Override
    public List<ST_PPTN_R> selectMultiStationYearRainfall(List<String> stcd,  String startTime, String endTime) {
        return ST_PPTN_RMapper.selectMultiStationYearRainfall(stcd,startTime,endTime);
    }

    @Override
    public ST_PPTN_R selectByTmNewEstData(String stcd, String tm) {
        // TODO Auto-generated method stub
        return ST_PPTN_RMapper.selectByTmNewEstData(stcd, tm);
    }

}
